package com.itheima.bookmanagerentry;

import com.itheima.bookcontroller.BaseBookController;
import com.itheima.bookcontroller.Book2Controller;
import com.itheima.bookcontroller.BookController;

import java.util.Random;

public class BookManagerEntry {

    public static void main(String[] args) {

//        BookController bookController = new BookController();
//        bookController.star();
        BaseBookController bookController = getBookController();
        bookController.star();

    }

    private static BaseBookController getBookController() {

        Random r = new Random();
        int i = r.nextInt(2);

        switch (i) {
            case 0 :
                return new BookController();

            case 1 :
                return new Book2Controller();

        }
        return null;
    }

}
